import { request } from '@inbiz/utils';
// const Mock = require('/Users/zhujiaqing/.nvm/versions/node/v14.15.3/lib/node_modules/mockjs');
// import InbizConfig from 'InbizConfig';

const version = InbizConfig.API_VERSION;

export async function getImgCate(params: Banner.ImgCateParams) {
  return request(
    `/inbiz/api/services/cms/v${version}/cms/cmsCategoryList`,
    {
      params: {
        pageIndex: 1,
        categoryType: 0,
        ...params,
      },
    },
  );
}

export async function getImgList(params: Banner.ListParams) {
  return request(
    `/inbiz/api/services/cms/v${version}/cms/contentList`,
    {
      params: {
        ...params,
        version: version,
        contentType: 0,
      },
    },
  );
}

export async function getDetail(params: Banner.DetailParams) {
  return request(
    `/inbiz/api/services/cms/v${version}/cms/${params.id}/detailContentInfo`,
    {
      params,
    },
  );
}
